<%@ include  file="Header.jsp" %>  
<jsp:directive.page import="java.util.ArrayList"/>
<jsp:directive.page import="java.util.Enumeration"/>
<jsp:directive.page import="java.util.StringTokenizer"/>  

<jsp:directive.page import="java.sql.*"/>
<jsp:directive.page import="Connectivity.ConnectionManager"/>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'CustomerEntry.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	

  </head>
  <script>
  
  
  </script>
  <body>
  <%//9370327988
//name=BANK+OF+BARODA
//&branch=23
//&problem1=1%24DESKTOP&DESKTOP=3%24ACER&LAPTOP=0
//&problem3=3%24PRINTER&PRINTER=20%24TVS+MSP+335
//&HWPARTS=0
//&callfault=aaaaaaaaa
//&callfault=bbbbbbbbb
//&callnature=1
//&calllockedby=ccccccccc
//&calllockedcontact=ddddddddd
//&submit=Create&complaintid=1GI2622012&complaintdate=26-2-2012
//&complainttime=19%3A57%3A35         
 String flag = "";
		 
		 String cust_id = request.getParameter("branch")!=null?request.getParameter("branch"):"";
		 String name = request.getParameter("name")!=null?request.getParameter("name"):"";
		 String callfault1= request.getParameter("callfault1")!=null?request.getParameter("callfault1"):"";
		 String callfault2 = request.getParameter("callfault2")!=null?request.getParameter("callfault2"):"";
		 String callnature = request.getParameter("callnature")!=null?request.getParameter("callnature"):"";
		 String calllockedby = request.getParameter("calllockedby")!=null?request.getParameter("calllockedby"):"";
		 String calllockedcontact = request.getParameter("calllockedcontact")!=null?request.getParameter("calllockedcontact"):"";
		 String complaintid = request.getParameter("complaintid")!=null?request.getParameter("complaintid"):"";
		 String complaintdate = request.getParameter("complaintdate")!=null?request.getParameter("complaintdate"):"";
		 String complainttime = request.getParameter("complainttime")!=null?request.getParameter("complainttime"):"";
		 String submit = request.getParameter("submit")!=null?request.getParameter("submit"):"";
 		 String groupcount = request.getParameter("groupcount")!=null?request.getParameter("groupcount"):"";
		 String []problemlist=null;
		 int gcount=Integer.parseInt(groupcount);
		 String callfault=callfault1+callfault2;
		 String group_id="";
	 		String problem="";
			String ParameterNames = "";
			ArrayList group=new ArrayList();
			ArrayList item=new ArrayList();
			ArrayList itemid=new ArrayList();
			int tokcnt=0;
			for(Enumeration e = request.getParameterNames(); e.hasMoreElements(); )
			{
				ParameterNames = (String)e.nextElement();
				//out.println(ParameterNames + "=<br/>");
				if(ParameterNames.contains("problem"))
				{
				problem=problem+"$"+request.getParameter(ParameterNames);
//				out.println(problem + "<br/>");
				StringTokenizer st=new StringTokenizer(problem,"$");
				while(st.hasMoreElements())
					{
					String grp=(st.nextToken());
					String grp1=(st.nextToken());
					group.add(grp);
					String itemdetails=request.getParameter(grp1);
					StringTokenizer st1=new StringTokenizer(itemdetails,"$");						
					String itemi= st1.nextToken();
					String itemna=st1.nextToken();
					itemid.add(itemi);
					}
	
				}
			}

				 



try
	{	 
	
	 
		 
		 //String creation_date="(select current_date)";
		
	String created_by=""+(session.getAttribute("uname"));
	System.out.println("cust_id"+cust_id);
	System.out.println("name"+name);
	System.out.println("gcount"+gcount);
	System.out.println("complainttime"+complainttime);
	System.out.println("callfault"+callfault1);
	System.out.println("callnature"+callnature);
	System.out.println("calllockedby"+calllockedby);
	System.out.println("calllockedcontact"+calllockedcontact);
	System.out.println("complaintid"+complaintid);
	System.out.println("complaintdate"+complaintdate);
	System.out.println("calllockedcontact"+calllockedcontact);
	System.out.println("submit"+submit);
	
	
	 
 
	PreparedStatement insertprst=con.prepareStatement(" Insert into callentry values(?,?,?,?,?,?,?,?,?,?,?,?,?) ");
  
  }
  catch(Exception e)
  {e.printStackTrace();}
   %>
 
  
  
  </body>
</html>
